//microcommand define 5k
signature("<text1> [text2]", { checkUnknown: true })
inject({ optional: ["assets"] })
option("alpha", "-a")
option("rainbow", "-r")
option("top", "-s, --single, -t")
option("bottom", "-b")
before(({ args, options }) => {
if (args.length < 1) return h.i18n("internal.insufficient-arguments")
if (args.length > (options.top || options.bottom ? 1 : 2)) return h.i18n("internal.redunant-arguments")
}, true)
action(async ({ options }, text1, text2) => {
const params = {
type: "png",
noalpha: "true",
}
if (options.alpha) delete params.noalpha
if (options.rainbow) params.rainbow = 'true'
if (options.top || options.bottom) {
params[options.top ? "top" : "bottom"] = text1
params.single = true
} else {
params.top = text1
if (text2) params.bottom = text2
else { params.bottom = "-"; params.hoshii = "true" }
}
let r = h.image("https://gsapi.cbrx.io/image?" + new URLSearchParams(params))
if (ctx.assets) r = await ctx.assets.transform([r])
return r
})
locale("zh-CN", { description: "想要5000兆圆!生成器", options: { alpha: "使用透明通道", rainbow: "彩虹色", top: "只渲染第一行", bottom: "只渲染第二行" } })